﻿SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON

GO


CREATE PROCEDURE [dbo].[bhp_temp_ModBlogTagsStructure]
AS
BEGIN

	DECLARE
		@BlogTagsTabId	INT


	SELECT @BlogTagsTabId = id FROM n_Tree WHERE name = 'BLOG_TAGS' AND typ = 'T' AND del = 0
		
	-- BLOG_POSTS.title
	EXEC [dbo].[n_ColFAdd] @rel = @BlogTagsTabId, @name = N'guid', @typ = 2, @siz1 = 1000, @siz2 = 1, @user = 900900
	INSERT INTO bht_Columns (ColumnId, DisplayName, HideForEdition)
	SELECT
		id, N'Unikalny identyfikator taga', 1
	FROM
		n_Tree t
	WHERE
		parent = @BlogTagsTabId
		AND name = N'guid'
		
	INSERT INTO bht_GroupExtensions (GroupId, RecordExtension)
		VALUES (@BlogTagsTabId, N'blackhouse.NemoBlog.Web.TagExtension,blackhouse.NemoBlog.Web');


END
GO

EXEC [bhp_temp_ModBlogTagsStructure]
GO

DROP PROCEDURE [bhp_temp_ModBlogTagsStructure]